<?php

namespace App\Services;

use App\User;
use Illuminate\Support\Facades\Auth;

class UserService
{
    public function login(array $info)
    {
        $user = User::where('email', $info['account'])->orWhere('mobile',  $info['account'])->first();

        if ($user) {
            Auth::login($user); //这里直接登录user了，不需要验证密码Auth::attempt([])需要验证条件
            return true;
        }
        return false;
    }
}
